import request from '@/utils/request'

// 查询厂房信息目录列表
export function listRoomsinformation(query) {
  return request({
    url: '/rooms/roomsinformation/list',
    method: 'get',
    params: query
  })
}

/**
 * 根据厂房编码查询厂房信息（包含名称）
 * @param {string} roomCode 厂房编码
 * @returns {Promise} 请求结果Promise
 */
export function getRoomNameByRoomCode(roomCode) {
  return request({
    url: `/rooms/roomsinformation/getRoomNameByRoomCode/${roomCode}`,
    method: 'get'
  })
}

// 查询厂房信息目录详细
export function getRoomsinformation(id) {
  return request({
    url: '/rooms/roomsinformation/' + id,
    method: 'get'
  })
}

// 新增厂房信息目录
export function addRoomsinformation(data) {
  return request({
    url: '/rooms/roomsinformation',
    method: 'post',
    data: data
  })
}

// 修改厂房信息目录
export function updateRoomsinformation(data) {
  return request({
    url: '/rooms/roomsinformation',
    method: 'put',
    data: data
  })
}

// 删除厂房信息目录
export function delRoomsinformation(id) {
  return request({
    url: '/rooms/roomsinformation/' + id,
    method: 'delete'
  })
}

// 查询所有厂房数据
export function findAllRoomsinformation() {
  return request({
    url: '/rooms/roomsinformation/findAll',
    method: 'post'
  })
}

